home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 5
/
Apprentice-Release5.iso
/
Source Code
/
Libraries
/
Dots & Pixels
/
headers
/
depthChange.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-09-29
|
1KB
|
40 lines
#pragma once
//
// depthChange is a simple class for temporarily changing the bit depth
// of a monitor.
// It is not fool-proof, but when used as intended no problems are to be
// expected.
// Intended use:
//
// {
// depthChange( 2); // switches main monitor to two-bit mode (if present!)
// //
// // Code to display a stereogram
// //
// } // automagically switches the monitor back to the old depth setting
//
// General warnings:
//
// foo = new depthChange( 2);
//
// probably is never needed.
//
// The first constructor effectively does nothing. It is there to allow
// subclasses (e.g. fullscreen) to not change the bit depth of the monitor.
//
// Known limitations:
//
// depthChange can not change the 'grayscale' setting of a graphics device.
//
class depthChange
{
public:
depthChange(); // does not actually change depth
depthChange( int newDepth, GDHandle aGDHandle = GetMainDevice());
~depthChange();
private:
GDHandle theGDHandle; // zero when no depth change occurred
const int oldDepth;
};